<!DOCTYPE html>





<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 3.9.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.4.0">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.4.0">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.4.0">
  <link rel="mask-icon" href="/images/logo.svg?v=7.4.0" color="#222">

<link rel="stylesheet" href="/css/main.css?v=7.4.0">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '7.4.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: '',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    },
    sidebarPadding: 40
  };
</script>


<script data-ad-client="ca-pub-8048531516491146" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

  <meta name="description" content="1、简介在定义接口时，经常会遇到参数个数甚至类型都不确定的情况。这时，在类 C 语言中我们可以使用省略号指定参数表，具体形式如下： 1void fun(parm1,parm2,...);  这种传参形式被称为 变长参数。C 语言中的： 1int printf(const char * format, ...)  便是两个最经典的例子。对于固定参数列表的函数，每个参数的名称、类型是直接可见的，他们的">
<meta name="keywords" content="C语言, va_list,va_arg,va_end,变长参数,printf">
<meta property="og:type" content="article">
<meta property="og:title" content="变长参数学习笔记">
<meta property="og:url" content="http://foogry.org/2018/11/18/2018-11-18-bian-chang-can-shu-xue-xi-bi-ji/index.html">
<meta property="og:site_name" content="foogry的技术博客">
<meta property="og:description" content="1、简介在定义接口时，经常会遇到参数个数甚至类型都不确定的情况。这时，在类 C 语言中我们可以使用省略号指定参数表，具体形式如下： 1void fun(parm1,parm2,...);  这种传参形式被称为 变长参数。C 语言中的： 1int printf(const char * format, ...)  便是两个最经典的例子。对于固定参数列表的函数，每个参数的名称、类型是直接可见的，他们的">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-09-24T12:14:54.779Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="变长参数学习笔记">
<meta name="twitter:description" content="1、简介在定义接口时，经常会遇到参数个数甚至类型都不确定的情况。这时，在类 C 语言中我们可以使用省略号指定参数表，具体形式如下： 1void fun(parm1,parm2,...);  这种传参形式被称为 变长参数。C 语言中的： 1int printf(const char * format, ...)  便是两个最经典的例子。对于固定参数列表的函数，每个参数的名称、类型是直接可见的，他们的">
  <link rel="canonical" href="http://foogry.org/2018/11/18/2018-11-18-bian-chang-can-shu-xue-xi-bi-ji/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true,
    isPage: false,
    isArchive: false
  };
</script>

  <title>变长参数学习笔记 | foogry的技术博客</title>
  


  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?2944231de73b405a5da5c6b4097cfa0e";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">
  <div class="container use-motion">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">foogry的技术博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <h1 class="site-subtitle" itemprop="description">Stay hungry,stay foolish.</h1>
      
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
      
      
      
        
        <li class="menu-item menu-item-home">
      
    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-archives">
      
    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-about">
      
    

    <a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
            

          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
      <article itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block post">
    <link itemprop="mainEntityOfPage" href="http://foogry.org/2018/11/18/2018-11-18-bian-chang-can-shu-xue-xi-bi-ji/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="foogry">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="foogry的技术博客">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">变长参数学习笔记

          
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              
                
              

              <time title="创建时间：2018-11-18 19:23:45" itemprop="dateCreated datePublished" datetime="2018-11-18T19:23:45+08:00">2018-11-18</time>
            </span>
          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2019-09-24 20:14:54" itemprop="dateModified" datetime="2019-09-24T20:14:54+08:00">2019-09-24</time>
              </span>
            
          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/C语言/" itemprop="url" rel="index"><span itemprop="name">C语言</span></a></span>

                
                
              
            </span>
          

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
        
      
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2018/11/18/2018-11-18-bian-chang-can-shu-xue-xi-bi-ji/#comments" itemprop="discussionUrl"><span class="post-comments-count valine-comment-count" data-xid="/2018/11/18/2018-11-18-bian-chang-can-shu-xue-xi-bi-ji/" itemprop="commentCount"></span></a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="1、简介"><a href="#1、简介" class="headerlink" title="1、简介"></a>1、简介</h2><p>在定义接口时，经常会遇到参数个数甚至类型都不确定的情况。这时，在类 C 语言中我们可以使用省略号指定参数表，具体形式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">void fun(parm1,parm2,...);</span><br></pre></td></tr></table></figure>

<p>这种传参形式被称为 <code>变长参数</code>。C 语言中的：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int printf(const char * format, ...)</span><br></pre></td></tr></table></figure>

<p>便是两个最经典的例子。对于固定参数列表的函数，每个参数的名称、类型是直接可见的，他们的地址和值也可以直接得到。但是对于变长参数的函数，该如何获取这些信息呢？</p>
<a id="more"></a>

<h2 id="2、实现原理"><a href="#2、实现原理" class="headerlink" title="2、实现原理"></a>2、实现原理</h2><p>函数的参数在内存中是以从右到左的顺序依次存放在栈中，最右侧的参数最先入栈，最左边的参数最后入栈，比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">void func(int x, float y, char z);</span><br></pre></td></tr></table></figure>

<p>在发生函数调用的时候，形参 z 先进栈，然后是 y，最后是 x，最终在内存中几个变量的存放次序是 x-&gt;y-&gt;z。</p>
<p>按照 C 标准，支持变长参数的函数声明中，必须至少在最左侧有一个固定参数。根据前文所述，形参在内存中是存放在栈中，而且顺序是连续的。因此，有了最左侧的 <code>固定参数</code> 和 <code>可变参数的类型</code>，我们就能获取到所有的可变参数的地址和值。</p>
<h2 id="3、变长参数获取"><a href="#3、变长参数获取" class="headerlink" title="3、变长参数获取"></a>3、变长参数获取</h2><h4 id="3-1-获取"><a href="#3-1-获取" class="headerlink" title="3.1 获取"></a>3.1 获取</h4><p>在 C 语言中 <code>&lt;stdarg.h&gt;</code> 文件中定义了几个用于获取变长参数的宏：</p>
<ul>
<li>va_list</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">typedef char* va_list;</span><br></pre></td></tr></table></figure>

<p>va_list 是一个字符指针，可以理解为指向当前参数的一个指针，所有对变长参数的获取都需要通过这个指针进行。因此，在获取变长参数之前，需要先定义一个 va_list 类型的变量，比如叫 <code>ap</code>。</p>
<ul>
<li>va_start</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">void va_start(va_list ap, param);</span><br></pre></td></tr></table></figure>

<p><code>ap</code> 定义好了后，需要通过 va_start 初始化，让它指向变长参数列表中的第一个。该函数的第一个参数就是前面定义好的 <code>ap</code>，第二个参数则是变长参数表前面紧挨着的变量（即 <code>...</code> 之前的那个）。</p>
<ul>
<li>va_arg</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">type va_arg(va_list ap, type);</span><br></pre></td></tr></table></figure>

<p>接下来便可以通过 va_arg 来按顺序获取变长参数列表中的每一个参数。该方法第一个参数是 <code>ap</code>，第二个参数是当前要获取的变长参数的类型；该方法的返回值便是当前要获取的参数值；每调用一次以后，便把 <code>ap</code> 指向了下一个变量的位置。</p>
<ul>
<li>va_end</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">void va_end(va_list ap);</span><br></pre></td></tr></table></figure>

<p>全部参数获取结束以后，需要调用 va_end 把 <code>ap</code> 指针关掉，以保证程序健壮性。因此，通常 va_start 和 va_end 是成对出现。</p>
<h4 id="3-2-内部实现"><a href="#3-2-内部实现" class="headerlink" title="3.2 内部实现"></a>3.2 内部实现</h4><p>在 VC++ 的 &lt;stdarg.h&gt; 里， x86 平台的上述宏定义实现如下 ：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">typedef char * va_list;</span><br><span class="line">#define _INTSIZEOF(n) \</span><br><span class="line">((sizeof(n)+sizeof(int)-1)&amp;~(sizeof(int) - 1) )</span><br><span class="line">#define va_start(ap,v) ( ap = (va_list)&amp;v + _INTSIZEOF(v) )</span><br><span class="line">#define va_arg(ap,t) \</span><br><span class="line">( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )</span><br><span class="line">#define va_end(ap) ( ap = (va_list)0 )</span><br></pre></td></tr></table></figure>

<p>其中，_INTSIZEOF 的实现方式时为了保证获取到的大小是 int 的整数倍。其它的宏实现就比较容易理解了。</p>
<h2 id="4、变长参数应用"><a href="#4、变长参数应用" class="headerlink" title="4、变长参数应用"></a>4、变长参数应用</h2><p>我们可以写一个简单版的 printf 来展示该方法的实现原理和变长参数的获取方法：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line">void mineprintf(char *fmt, ...)</span><br><span class="line">&#123;</span><br><span class="line">    va_list ap;</span><br><span class="line">    char *p, *sval;</span><br><span class="line">    int ival;</span><br><span class="line">    double dval;</span><br><span class="line">    </span><br><span class="line">    va_start(ap, fmt);</span><br><span class="line">    for (p = fmt; *p; p++) &#123;</span><br><span class="line">        if (*p != &apos;%&apos;) &#123;</span><br><span class="line">            putchar(*p);</span><br><span class="line">            continue;</span><br><span class="line">        &#125;</span><br><span class="line">        </span><br><span class="line">        switch (*++p) &#123;</span><br><span class="line">            case &apos;d&apos;:</span><br><span class="line">                ival = va_arg(ap, int);</span><br><span class="line">                printf(&quot;%d&quot;,ival);</span><br><span class="line">                break;</span><br><span class="line">            case &apos;f&apos;:</span><br><span class="line">                dval = va_arg(ap, double);</span><br><span class="line">                printf(&quot;%f&quot;,dval);</span><br><span class="line">                break;</span><br><span class="line">            case &apos;s&apos;:</span><br><span class="line">                for (sval = va_arg(ap, char *); *sval; sval++) &#123;</span><br><span class="line">                    putchar(*sval);</span><br><span class="line">                &#125;</span><br><span class="line">                break;</span><br><span class="line">            default:</span><br><span class="line">                putchar(*p);</span><br><span class="line">                break;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    va_end(ap);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="参考文档"><a href="#参考文档" class="headerlink" title="参考文档"></a>参考文档</h2><ul>
<li><p>C程序设计语言（第2版）K&amp;R</p>
</li>
<li><p><a href="https://stackoverflow.com/a/22643365" target="_blank" rel="noopener">Implementation of __builtin_va_start(v,l)</a></p>
</li>
</ul>

    </div>

    
    
    
        
      
        <div id="reward-container">
  <div></div>
  <button id="reward-button" disable="enable" onclick="var qr = document.getElementById(&quot;qr&quot;); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
        
      
      <div style="display: inline-block">
        <img src="/images/weixinpay.jpg" alt="foogry 微信支付">
        <p>微信支付</p>
      </div>

  </div>
</div>

      
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>foogry</li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="http://foogry.org/2018/11/18/2018-11-18-bian-chang-can-shu-xue-xi-bi-ji/" title="变长参数学习笔记">http://foogry.org/2018/11/18/2018-11-18-bian-chang-can-shu-xue-xi-bi-ji/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i>BY-NC-ND</a> 许可协议。转载请注明出处！</li>
</ul>
</div>

      

      <footer class="post-footer">
          
            
          
          <div class="post-tags">
            
              <a href="/tags/C语言/" rel="tag"># C语言</a>
            
              <a href="/tags/va-list/" rel="tag"># va_list</a>
            
              <a href="/tags/va-arg/" rel="tag"># va_arg</a>
            
              <a href="/tags/va-end/" rel="tag"># va_end</a>
            
              <a href="/tags/变长参数/" rel="tag"># 变长参数</a>
            
              <a href="/tags/printf/" rel="tag"># printf</a>
            
          </div>
        

        

          <div class="post-nav">
            <div class="post-nav-next post-nav-item">
              
                <a href="/2018/11/15/2018-11-15-try-catch-yuan-li-pou-xi/" rel="next" title="try catch 原理剖析">
                  <i class="fa fa-chevron-left"></i> try catch 原理剖析
                </a>
              
            </div>

            <span class="post-nav-divider"></span>

            <div class="post-nav-prev post-nav-item">
              
                <a href="/2019/09/18/2019-09-18-ios-ding-wei-quan-xian-na-xie-shi/" rel="prev" title="iOS 定位权限那些事">
                  iOS 定位权限那些事 <i class="fa fa-chevron-right"></i>
                </a>
              
            </div>
          </div>
        
      </footer>
    
  </div>
  
  
  
  </article>

  </div>


          </div>
          
    
    <div class="comments" id="comments"></div>
  

        </div>
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">
        
        
        
        
      

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、简介"><span class="nav-number">1.</span> <span class="nav-text">1、简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、实现原理"><span class="nav-number">2.</span> <span class="nav-text">2、实现原理</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、变长参数获取"><span class="nav-number">3.</span> <span class="nav-text">3、变长参数获取</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#3-1-获取"><span class="nav-number">3.0.1.</span> <span class="nav-text">3.1 获取</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-2-内部实现"><span class="nav-number">3.0.2.</span> <span class="nav-text">3.2 内部实现</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4、变长参数应用"><span class="nav-number">4.</span> <span class="nav-text">4、变长参数应用</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#参考文档"><span class="nav-number">5.</span> <span class="nav-text">参考文档</span></a></li></ol></div>
        
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">foogry</p>
  <div class="site-description" itemprop="description"></div>
</div>
  <nav class="site-state motion-element">
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">22</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    
      
      
      <div class="site-state-item site-state-categories">
        
        <span class="site-state-item-count">8</span>
        <span class="site-state-item-name">分类</span>
        
      </div>
    
      
      
      <div class="site-state-item site-state-tags">
        
        <span class="site-state-item-count">56</span>
        <span class="site-state-item-name">标签</span>
        
      </div>
    
  </nav>
  <div class="cc-license motion-element" itemprop="license">
    
  
    <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-nd.svg" alt="Creative Commons"></a>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">foogry</span>
</div>
  <div class="powered-by">Hosted by <a href="https://coding.net/pages" class="theme-link" rel="noopener" target="_blank">Coding Pages</a></div>
  <span class="post-meta-divider">|</span>
  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a> v7.4.0</div>

        












        
      </div>
    </footer>
  </div>

  


  <script src="/lib/anime.min.js?v=3.1.0"></script>
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script src="/js/utils.js?v=7.4.0"></script><script src="/js/motion.js?v=7.4.0"></script>
<script src="/js/schemes/pisces.js?v=7.4.0"></script>
<script src="/js/next-boot.js?v=7.4.0"></script>



  





















  

  

  


<script>
NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
  var GUEST = ['nick', 'mail', 'link'];
  var guest = 'nick,mail,link';
  guest = guest.split(',').filter(item => {
    return GUEST.includes(item);
  });
  new Valine({
    el: '#comments',
    verify: false,
    notify: false,
    appId: 'vqsvFaA8FXndr4867HJvtJ7P-gzGzoHsz',
    appKey: '6L6ddsrLCJVMetc2W7CL9kkf',
    placeholder: 'Comment Here',
    avatar: 'mm',
    meta: guest,
    pageSize: '10' || 10,
    visitor: false,
    lang: 'zh-cn' || 'zh-cn',
    path: location.pathname
  });
}, window.Valine);
</script>

</body>
</html>
